#ifndef __LISTHEADER_H__
#define __LISTHEADER_H__

#include <vector>
#include <iostream>
using namespace std;

typedef struct List {
	int Data;
	List* next;
}List;

List* InitList(const vector<int> datas) {
	List* temp = new List;
	temp->Data = datas[0];
	temp->next = nullptr;

	List* head = temp;
	List* pHead = head;

	for (int i = 1; i < datas.size(); i++) {
		temp = new List;
		temp->Data = datas[i];
		temp->next = nullptr;

		pHead->next = temp;
		pHead = pHead->next;
	}

	return head;
}

void PrintList(List* head) {
	while (head != nullptr) {
		cout << head->Data << ", ";
		head = head->next;
	}

	cout << endl;
}

#endif // !__LISTHEADER_H__

